#!/usr/bin/python
import json
import time
import os
import socket

from Dev_state import Dev
from serve_json import Json_encoder,Json_decoder

print "Connecting ...",
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
print "done"

print "Connecting to remote host...",
s.connect(("127.0.0.1",50000))
print "done"

while True:
    try:
        json_data = s.recv(4096)
    except socket.error, e:
        print "Error receiving data  : %s" %e
    data = Json_decoder.decode(json_data)
    
    print data
    

